package com.ep.modules.app.controller;

import com.ep.common.annotation.SysLog;
import com.ep.common.utils.PageUtils;
import com.ep.common.utils.R;
import com.ep.common.validator.ValidatorUtils;
import com.ep.modules.app.entity.AppRealTimeExperienceMonitor;
import com.ep.modules.app.service.AppRealTimeExperienceMonitorService;
import java.util.Map;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/real_time_experience_monitor")
public class AppRealTimeExperienceMonitorController {
    @Autowired
    private AppRealTimeExperienceMonitorService appRealTimeExperienceMonitorService;

    @GetMapping("/list")
    public R list(Map<String, Object> params) {
        PageUtils page = appRealTimeExperienceMonitorService.queryPage(params);
        return R.ok().put("page", page);
    }

    @GetMapping("/info/{id}")
    public R info(@PathVariable Long id) {
        AppRealTimeExperienceMonitor apprealtimeexperiencemonitor = appRealTimeExperienceMonitorService.getById(id);
        return R.ok().put("apprealtimeexperiencemonitor", apprealtimeexperiencemonitor);
    }

    @SysLog("保存AppRealTimeExperienceMonitor")
    @PostMapping("/save")
    public R save(@RequestBody AppRealTimeExperienceMonitor apprealtimeexperiencemonitor) {
        ValidatorUtils.validateEntity(apprealtimeexperiencemonitor);
        appRealTimeExperienceMonitorService.save(apprealtimeexperiencemonitor);
        return R.ok();
    }

    @SysLog("修改AppRealTimeExperienceMonitor")
    @PostMapping("/update")
    public R update(@RequestBody AppRealTimeExperienceMonitor apprealtimeexperiencemonitor) {
        ValidatorUtils.validateEntity(apprealtimeexperiencemonitor);
        appRealTimeExperienceMonitorService.update(apprealtimeexperiencemonitor);
        return R.ok();
    }

    @SysLog("删除AppRealTimeExperienceMonitor")
    @PostMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        appRealTimeExperienceMonitorService.deleteBatch(ids);
        return R.ok();
    }
}